package com.yunupmall.mapper.FordMapper;

import com.yunupmall.api.fordentity.Kind;
import com.yunupmall.api.fordentity.SpecsCommodity;
import com.yunupmall.entity.ford.FordCommodity;
import com.yunupmall.entity.ford.FordCommtoty;
import com.yunupmall.entity.ford.FordSpecsCommodity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface IndexMapper {
    //查询全部种类信息
    @Select("select * from kind")
    List<Kind> fordquertykind();

    @Select("SELECT id as c_id,c_name,c_price,exampleImage1 from commodity where kind_id=#{id}")
    List<FordCommtoty> getCommtityData(@Param("id") Integer id);

    //加载图片信息、
    @Select("select * from commodity where id=#{id}")
    List<FordCommodity> getcommtotyimage(@Param("id") Integer id);

    //加载商品信息
    @Select("select * from commodity where id=#{id}")
    FordCommodity getcomData(@Param("id") Integer id);

    //加载商品规格信息
    @Select("SELECT * from specs_commodity WHERE c_id=#{c_id}")
    List<SpecsCommodity> getskuspecs(@Param("c_id") Integer c_id);

    // //查询商品库存
    @Select("select * from specs_commodity where id=#{id}")
    FordSpecsCommodity queryspecsskudata(@Param("id") Integer id);
}
